package org.wattdepot.cli;

import org.wattdepot.client.WattDepotClient;

/**
 * Defines a few critical functions, as well as message constants across the board.
 * 
 * @author Aaron Herres
 * 
 */
public interface SingleCommand {

  /**
   * process the command line parameter for a specific command.
   * 
   * @param client The WattDepotClient to use in connections.
   * @param args The argument string.
   * @return the output message.
   */
  public String processCommand(WattDepotClient client, String args[]);

  /**
   * Returns the usage string for a particular command.
   * 
   * @return The usage string.
   */
  public String usageString();

  /**
   * Encapsulates the string messages for the cli.
   * 
   * @author Aaron Herres
   * 
   */
  public static class Messages {

    /**
     * Encapsulates the error messages for the cli.
     * 
     * @author Aaron Herres
     * 
     */
    public static class Error {
      /** The message displayed when the user inputs something invalid. */
      public static final String INVALID_INPUT = "The input string was invalid.";
      /** The message displayed when the client is not ready. */
      public static final String CLIENT_NOT_READY = "The client isn't ready";
      /** The message displayed when the code reaches an unimplemented feature. */
      public static final String UNIMPLEMENTED = "Feature not implemented.";
      /** The message displayed when the user inputs an invalid timestamp. */
      public static final String INVALID_TIMESTAMP =
          "Invalid timestamp format. Should be: 2009-11-15T12:00:00.000-10:00";
      /** The message displayed when the user inputs an invalid power type. */
      public static final String INVALIDPOWERTYPE =
          "The specified power type cannot be found in the source";
      /** The message displayed when the user inputs an invalid source. */
      public static final String INVALIDSOURCE =
          "The source specified is invalid for this operation.";
      /** The message displayed when the client sends a bad xml. */
      public static final String BAD_XML = "Xml was bad.";
      /** The message displayed when a resource cannot be found. */
      public static final String RESOURCE_NOT_FOUND = "The specified resource could not be found.";
      /** The message displayed when the client is not authorized for this operation. */
      public static final String NOT_AUTHORIZED = "Client was unauthorized.";

    }
  }
}
